import xmlrpclib
import pickle

class ServerProxy(xmlrpclib.ServerProxy):
    def __init__(self, host, port):
        xmlrpclib.ServerProxy.__init__(self, host + ":" + str(port), allow_none=True)
        
    def __getattr__(self, name):
        def proxy(*args):
             method = xmlrpclib.ServerProxy.__getattr__(self, name)
             response = method(*args)
             return pickle.loads(response)
        return proxy